package com.xyrl.project.app.controller.common;

import com.xyrl.project.common.base.vo.ResponseData;
import com.xyrl.project.common.system.entity.Areas;
import com.xyrl.project.common.system.service.AreasService;
import com.xyrl.project.common.system.vo.AreasVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className AreasController
 * @company 星纭融链科技服务有限公司
 * @author 徐恩源
 * @version 1.0
 * @date 2019-12-30 11:45:58
 * @Description 地区controller
 */
@Slf4j
@RestController
@RequestMapping("/common/areas")
@Api(value = "地区", tags = "公共模块")
public class AreasController {
    @Autowired
    private AreasService areasService;

    @ApiOperation(value = "获得地区数据")
    @GetMapping
    public ResponseData get() {
        List<AreasVo> areas = areasService.getAll();
        return ResponseData.success(areas);
    }
}
